import { SET_USER,SET_SAGALIST,GET_SAGALIST,ADD_SAGALISTITEM,DELETE_SAGALISTITEM } from '../constants'

export const simpleSetUser = (user)=> {
    return dispatch=>{
        setTimeout(()=>{
            dispatch({
                type:SET_USER,
                payload:user
            })
        },600);
    }
}

export const getSagaList =()=>{
    return {
        type:GET_SAGALIST
    }
}

export const setSagaListAction = (list)=>{
    return {
        type:SET_SAGALIST,
        payload:list
    }
}

export const addSagaListItem = (item) =>{
    return dispatch=>{
        dispatch({
            type:ADD_SAGALISTITEM,
            payload:item
        })
    }
}

export const deleteSagaListItem = (index) =>{
    return {
        type:DELETE_SAGALISTITEM,
        payload:index
    }
}